package com.example.demo.core.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 填充器
 */
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {

    private static final Logger logger = LoggerFactory.getLogger(MyMetaObjectHandler.class);

    @Override
    public void insertFill(MetaObject metaObject) {
       logger.info("start insert fill ....");
//       metaObject.setValue("operator","Jerry");
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        logger.info("start update fill ....");
//        this.setFieldValByName("operator","Tom",metaObject);
    }
}
